sentences = """           # 字符串很长时用三个引号
When in the course of human events, 
it becomes necessary for one people todissolve 
the political bands which have connected them with another, 
and to assume among the powers of the earth, 
the separate and equal station to which the laws Nature 
and Nature’s God entitle them, a decent respect to 
the opinions of mankind requires that they should declare 
the causes which impelthem to the separation.
"""
#具体实现
#  将句子里面的逗号去掉,去掉多种符号时请用循环，这里我就这样吧
sentences=sentences.replace(',','')
sentences=sentences.replace('.','')   #  将句子里面的.去掉
sentences = sentences.split()         # 将句子分开为单个的单词，分开后产生的是一个列表sentences
# print(sentences)
count_dict = {}
for sentence in sentences:
    if sentence not in count_dict:    # 判断是否不在统计的字典中
        count_dict[sentence] = 1
    else:                              # 判断是否不在统计的字典中
        count_dict[sentence] += 1
for key,value in count_dict.items():
    print(f"{key}---出现了---{value}次")
